<html>
<head><meta charset="utf-8"><title>Inline const expressions · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html">Inline const expressions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210065916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210065916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210065916">(Sep 14 2020 at 21:32)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> The first step is making this parse, yes. The tests in<code>src/test/ui/parser/</code>are a good precedent.</p>



<a name="210066220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210066220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210066220">(Sep 14 2020 at 21:35)</a>:</h4>
<p>Well, actually most of them are <code>compile-fail</code>. Perhaps you could look at the first few PRs for <code>async</code> blocks? I think you'll be able to figure something out.</p>



<a name="210068266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210068266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210068266">(Sep 14 2020 at 21:58)</a>:</h4>
<p>right</p>



<a name="210068287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210068287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210068287">(Sep 14 2020 at 21:58)</a>:</h4>
<p>that's what I also thought, checking <code>async</code> and/or <code>unsafe</code></p>



<a name="210781149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210781149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210781149">(Sep 21 2020 at 18:27)</a>:</h4>
<p>sorry that I haven't commented about this, I didn't have time to properly start until now</p>



<a name="210781163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210781163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210781163">(Sep 21 2020 at 18:27)</a>:</h4>
<p>but I'm right now trying to invest some minutes on this</p>



<a name="210781303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210781303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210781303">(Sep 21 2020 at 18:28)</a>:</h4>
<p>I'm going to add this under <code>inline_const</code> feature flag, is that right?</p>



<a name="210782031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782031">(Sep 21 2020 at 18:35)</a>:</h4>
<p>There's been some disagreement around what this should be called. As the implementer, it's up to you. That's the name I would prefer, since it's clearer about what's going on behind the scenes and also someday we might have inline constants that don't actually look like <code>const { }</code> (the new <code>asm</code> macro has this already).</p>



<a name="210782160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782160">(Sep 21 2020 at 18:36)</a>:</h4>
<p>However,  if you feel strongly one way or the other, do that.</p>



<a name="210782202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782202">(Sep 21 2020 at 18:36)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span>, would use that one would be easy to rename if consensus arise about a different name</p>



<a name="210782262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782262">(Sep 21 2020 at 18:37)</a>:</h4>
<p>I'm procrastinating on how to organize myself on tackling this issue :P</p>



<a name="210782313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782313">(Sep 21 2020 at 18:37)</a>:</h4>
<p>but I guess I'm going to start adding the flag, then parsing and so on, so a top down approach</p>



<a name="210782335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782335">(Sep 21 2020 at 18:38)</a>:</h4>
<p>I have doubts on how to test things along the way but ...</p>



<a name="210782492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782492">(Sep 21 2020 at 18:39)</a>:</h4>
<p>I was more or less laying this out <a href="https://hackmd.io/2BGhGBkLRYK_V3keeLdWig">https://hackmd.io/2BGhGBkLRYK_V3keeLdWig</a></p>



<a name="210782509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782509">(Sep 21 2020 at 18:39)</a>:</h4>
<p>but I'm not sure to be honest, I guess I'll find out as I go</p>



<a name="210782519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782519">(Sep 21 2020 at 18:39)</a>:</h4>
<p>but in case there's something wrong there please let me know</p>



<a name="210782541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782541">(Sep 21 2020 at 18:39)</a>:</h4>
<p>there's stuff that I took from some comments here and there</p>



<a name="210782613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782613">(Sep 21 2020 at 18:40)</a>:</h4>
<p>No worries, yeah, that's the correct approach. You've just got to dive in. The compiler will guide you as you work your way down. <code>// compile-flags: -Z parse-only</code> might be helpful for testing by the way.</p>



<a name="210782653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782653">(Sep 21 2020 at 18:40)</a>:</h4>
<p>to test parsing?</p>



<a name="210782659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782659">(Sep 21 2020 at 18:40)</a>:</h4>
<p>cool</p>



<a name="210782721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782721">(Sep 21 2020 at 18:41)</a>:</h4>
<p>I have been wondering and also procrastinating if there's not a PR that more or less does something similar to just compare and such</p>



<a name="210782935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782935">(Sep 21 2020 at 18:42)</a>:</h4>
<p>grepping for that in the test suite might help if you're looking for inspiration when writing parser tests</p>



<a name="210782995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210782995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210782995">(Sep 21 2020 at 18:43)</a>:</h4>
<p>Like I said, I don't know of anything in particular. You're free to look around of course.</p>



<a name="210783406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210783406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210783406">(Sep 21 2020 at 18:47)</a>:</h4>
<p>Might be able to look at <code>async {}</code> blocks or <code>catch{}</code> blocks (from way back).</p>



<a name="210783671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210783671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210783671">(Sep 21 2020 at 18:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125270">scottmcm</span> <a href="#narrow/stream/131828-t-compiler/topic/Inline.20const.20expressions/near/210783406">said</a>:</p>
<blockquote>
<p>Might be able to look at <code>async {}</code> blocks or <code>catch{}</code> blocks (from way back).</p>
</blockquote>
<p>gonna check <code>catch {}</code></p>



<a name="210783960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210783960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210783960">(Sep 21 2020 at 18:52)</a>:</h4>
<p>tangent in case I forget it later: for steps except parsing, I would expect this to be nearly identical to repeat expressions <code>[0; expr]</code>, so it probably makes sense to mostly copy what we are doing there</p>



<a name="210787245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210787245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210787245">(Sep 21 2020 at 19:17)</a>:</h4>
<p>is precedence of this kind of stuff discussed somewhere?</p>



<a name="210787281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210787281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210787281">(Sep 21 2020 at 19:17)</a>:</h4>
<p>I'd expect this to live here <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_ast/src/util/parser.rs#L328-L336">https://github.com/rust-lang/rust/blob/master/compiler/rustc_ast/src/util/parser.rs#L328-L336</a> but just in case ...</p>



<a name="210787495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210787495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210787495">(Sep 21 2020 at 19:19)</a>:</h4>
<p>yeah, I don't think we ever need parens here</p>



<a name="210788250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788250">(Sep 21 2020 at 19:25)</a>:</h4>
<p>I don't know if <code>master</code> has moved since you sent that, but I'd expect it goes with <code>Loop</code> and <code>TryBlock</code> and <code>Async</code> and <code>Struct</code> in the section below the highlighted one.</p>



<a name="210788355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788355">(Sep 21 2020 at 19:26)</a>:</h4>
<p>oh ups, yeah. I expect us to return <code>PREC_PAREN</code> for inline consts</p>



<a name="210788375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788375">(Sep 21 2020 at 19:26)</a>:</h4>
<p>thought you linked to that match arm</p>



<a name="210788403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788403">(Sep 21 2020 at 19:27)</a>:</h4>
<p>yeah, sorry, I meant that section</p>



<a name="210788409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788409">(Sep 21 2020 at 19:27)</a>:</h4>
<p>I've wrongly edited it</p>



<a name="210788584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788584">(Sep 21 2020 at 19:28)</a>:</h4>
<p>another question, in features that are not yet stabilized as this one, how is in general checked the activation of the feature?</p>



<a name="210788609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788609">(Sep 21 2020 at 19:29)</a>:</h4>
<p>I meant, is it explicitly checked in the parser?</p>



<a name="210788631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788631">(Sep 21 2020 at 19:29)</a>:</h4>
<p>is it automagically done in some way?</p>



<a name="210788805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788805">(Sep 21 2020 at 19:30)</a>:</h4>
<p>I think we don't have to put the parser changes between a feature gate</p>



<a name="210788858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788858">(Sep 21 2020 at 19:31)</a>:</h4>
<p>We have an ast pass which checks for feature gates which we use for const generics</p>



<a name="210788880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788880">(Sep 21 2020 at 19:31)</a>:</h4>
<p>which is probably also what we can use here</p>



<a name="210788947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210788947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210788947">(Sep 21 2020 at 19:32)</a>:</h4>
<p>right, that's what I was looking for :)</p>



<a name="210789883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210789883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210789883">(Sep 21 2020 at 19:41)</a>:</h4>
<p>I thought we do need to check in the parser so that it can't be put in a <code>#[cfg]</code> on stable?</p>



<a name="210789934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210789934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210789934">(Sep 21 2020 at 19:41)</a>:</h4>
<p>(To avoid accidentally being forced to parse the syntax forever even if it's never stable)</p>



<a name="210790260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210790260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210790260">(Sep 21 2020 at 19:45)</a>:</h4>
<p>that's true, don't we have that issue with const generics too <span aria-label="shock" class="emoji emoji-1f628" role="img" title="shock">:shock:</span></p>



<a name="210790303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210790303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210790303">(Sep 21 2020 at 19:45)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125270">scottmcm</span> <a href="#narrow/stream/131828-t-compiler/topic/Inline.20const.20expressions/near/210789883">said</a>:</p>
<blockquote>
<p>I thought we do need to check in the parser so that it can't be put in a <code>#[cfg]</code> on stable?</p>
</blockquote>
<p>ohh makes sense</p>



<a name="210790620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210790620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210790620">(Sep 21 2020 at 19:48)</a>:</h4>
<p>maybe grep <code>self.sess.gated_spans.gate(sym::async_closure, span); </code>then</p>



<a name="210790644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210790644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210790644">(Sep 21 2020 at 19:48)</a>:</h4>
<p>which seems like a good starting point <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="210797731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210797731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210797731">(Sep 21 2020 at 20:47)</a>:</h4>
<p>when lowering the ast expression to hir, isn't it a way to generate noop or something like that?</p>



<a name="210797775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210797775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210797775">(Sep 21 2020 at 20:47)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_ast_lowering/src/expr.rs#L28">https://github.com/rust-lang/rust/blob/master/compiler/rustc_ast_lowering/src/expr.rs#L28</a></p>



<a name="210797865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210797865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210797865">(Sep 21 2020 at 20:48)</a>:</h4>
<p>like I guess it's nice if there <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span> I can just generate something that it's just ignored</p>



<a name="210797890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210797890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210797890">(Sep 21 2020 at 20:48)</a>:</h4>
<p>was going to do</p>



<a name="210797896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210797896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210797896">(Sep 21 2020 at 20:48)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="w">                </span><span class="n">ExprKind</span>::<span class="n">AnonConst</span><span class="p">(</span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="n">unimplemented</span><span class="o">!</span><span class="p">();</span><span class="w"></span>
<span class="w">                </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="210797924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210797924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210797924">(Sep 21 2020 at 20:49)</a>:</h4>
<p>but that would crash :)</p>



<a name="210797979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210797979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210797979">(Sep 21 2020 at 20:49)</a>:</h4>
<p>well I guess to test it <code>-Z parse-only</code> won't exercise that so it will be fine</p>



<a name="210798103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210798103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210798103">(Sep 21 2020 at 20:50)</a>:</h4>
<p>yeah, if you want to use <code>parse-only</code> this is hopefully enough <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="210798120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210798120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210798120">(Sep 21 2020 at 20:50)</a>:</h4>
<p>Otherwise you might use a <code>ExprKind::Lit</code> with some dummy value here</p>



<a name="210798327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210798327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210798327">(Sep 21 2020 at 20:52)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="210798337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210798337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210798337">(Sep 21 2020 at 20:52)</a>:</h4>
<p>makes sense</p>



<a name="210798542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210798542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210798542">(Sep 21 2020 at 20:54)</a>:</h4>
<p>or add <code>ExprKind::InlineConst</code> and  just keep on working without ever testing your changes, it's not like there could be any issues <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="210799553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210799553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210799553">(Sep 21 2020 at 21:02)</a>:</h4>
<p>right, it will work :)</p>



<a name="210799575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210799575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210799575">(Sep 21 2020 at 21:03)</a>:</h4>
<p>but anyway, let's do the "right" thing :P</p>



<a name="210800402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210800402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210800402">(Sep 21 2020 at 21:09)</a>:</h4>
<p>I've just written a test without the feature flag and I'm getting</p>



<a name="210800405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210800405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210800405">(Sep 21 2020 at 21:09)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: expected identifier, found `{`
  --&gt; /home/santiago/src/oss/rust3/src/test/ui/parser/inline_const.rs:5:11
   |
LL |     const {
   |           ^ expected identifier

error: aborting due to previous error
</code></pre></div>



<a name="210800714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210800714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210800714">(Sep 21 2020 at 21:11)</a>:</h4>
<p>I'm calling <code>self.sess.gated_spans.gate(sym::inline_const, span);</code></p>



<a name="210800811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210800811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210800811">(Sep 21 2020 at 21:12)</a>:</h4>
<p>I would have guessed that that would show an error mentioning that the feature flag is not on?</p>



<a name="210800831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210800831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210800831">(Sep 21 2020 at 21:12)</a>:</h4>
<p>well, need to read <code>gate</code> fn code</p>



<a name="210801858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210801858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210801858">(Sep 21 2020 at 21:22)</a>:</h4>
<p>Without the feature flag the parser likely tries to parse it as a <code>const NAME: Type = Expr;</code> item</p>



<a name="210801861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210801861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210801861">(Sep 21 2020 at 21:22)</a>:</h4>
<p>no, I think this is wrongly parsed, I'm adding code to parse this on parser/expr.rs but this is catched earlier</p>



<a name="210802069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210802069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210802069">(Sep 21 2020 at 21:24)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> I was answering to myself but I think yeah I'm doing this too late regardless of the feature flag</p>



<a name="210802599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210802599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210802599">(Sep 21 2020 at 21:29)</a>:</h4>
<p>I guess I need to do what I'm doing, which is parsing <code>const {</code> on expr but adjust ...</p>



<a name="210802630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210802630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210802630">(Sep 21 2020 at 21:29)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#L864-L871">https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#L864-L871</a></p>



<a name="210802720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210802720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210802720">(Sep 21 2020 at 21:30)</a>:</h4>
<p>to look ahead that it's not a <code>const {</code> thing</p>



<a name="210802725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210802725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210802725">(Sep 21 2020 at 21:30)</a>:</h4>
<p>?</p>



<a name="210802962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210802962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210802962">(Sep 21 2020 at 21:32)</a>:</h4>
<p>might it be easier to use <code>self.eat_keywork(kw::Const)</code> directly here</p>



<a name="210802993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210802993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210802993">(Sep 21 2020 at 21:32)</a>:</h4>
<p>at the same place we are currently parsing async blocks</p>



<a name="210803023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803023">(Sep 21 2020 at 21:33)</a>:</h4>
<p>you meant to just parse the expression at that point?</p>



<a name="210803148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803148">(Sep 21 2020 at 21:34)</a>:</h4>
<p>I would expect us to work in <code>compiler/rustc_parse/src/parser/expr.rs</code></p>



<a name="210803183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803183">(Sep 21 2020 at 21:34)</a>:</h4>
<p>around line <code>1050</code></p>



<a name="210803264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803264">(Sep 21 2020 at 21:35)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="k">else</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">eat_keyword</span><span class="p">(</span><span class="n">kw</span>::<span class="n">Const</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="bp">self</span><span class="p">.</span><span class="n">parse_block_expr</span><span class="o">..</span><span class="p">.</span><span class="w"> </span><span class="p">(</span><span class="n">or</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">new</span><span class="w"> </span><span class="n">method</span><span class="w"> </span><span class="n">which</span><span class="w"> </span><span class="n">uses</span><span class="w"> </span><span class="n">block</span><span class="w"> </span><span class="n">parsing</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="210803300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803300">(Sep 21 2020 at 21:35)</a>:</h4>
<p>similar to <code>kw::Unsafe</code> I guess</p>



<a name="210803395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803395">(Sep 21 2020 at 21:36)</a>:</h4>
<p>yeah, so ... that's exactly what I'm doing</p>



<a name="210803407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803407">(Sep 21 2020 at 21:36)</a>:</h4>
<p>can you show me the diff</p>



<a name="210803426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803426">(Sep 21 2020 at 21:36)</a>:</h4>
<p>cause I would expect this to work</p>



<a name="210803435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803435">(Sep 21 2020 at 21:36)</a>:</h4>
<p>(or the github link)</p>



<a name="210803445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803445">(Sep 21 2020 at 21:36)</a>:</h4>
<p>let me push</p>



<a name="210803512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803512">(Sep 21 2020 at 21:37)</a>:</h4>
<p><a href="https://github.com/spastorino/rust/tree/const-exprs-rfc-2920">https://github.com/spastorino/rust/tree/const-exprs-rfc-2920</a></p>



<a name="210803755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803755">(Sep 21 2020 at 21:40)</a>:</h4>
<p>I don't think we want to use <code>parse_anon_const_expr</code></p>



<a name="210803771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803771">(Sep 21 2020 at 21:40)</a>:</h4>
<p>that's used to parse array lengths and repeat expressions</p>



<a name="210803797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803797">(Sep 21 2020 at 21:40)</a>:</h4>
<p><code>const {</code> can be parsed like an ordinary block</p>



<a name="210803850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803850">(Sep 21 2020 at 21:41)</a>:</h4>
<p>so I expect the following to work</p>
<div class="codehilite"><pre><span></span><code><span class="k">fn</span> <span class="nf">test</span><span class="p">()</span><span class="w">  </span>-&gt; <span class="kt">usize</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="mi">7</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">3</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="n">x</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">5</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="210803877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803877">(Sep 21 2020 at 21:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/131828-t-compiler/topic/Inline.20const.20expressions/near/210803755">said</a>:</p>
<blockquote>
<p>I don't think we want to use <code>parse_anon_const_expr</code></p>
</blockquote>
<p>but this just parses an expr and returns an <code>AnonConst</code> out of that</p>



<a name="210803935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803935">(Sep 21 2020 at 21:42)</a>:</h4>
<p>yeah, but we want to parse a <em>block</em>, not an <em>expression</em></p>



<a name="210803964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803964">(Sep 21 2020 at 21:42)</a>:</h4>
<p>ohh right, I'm not parsing that</p>



<a name="210803966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803966">(Sep 21 2020 at 21:42)</a>:</h4>
<p>ok ok</p>



<a name="210803989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210803989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210803989">(Sep 21 2020 at 21:42)</a>:</h4>
<p>need to leave now, thanks for helping</p>



<a name="210804000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210804000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210804000">(Sep 21 2020 at 21:42)</a>:</h4>
<p>I might also be missing something here though, because blocks are expressions <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="210804019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210804019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210804019">(Sep 21 2020 at 21:42)</a>:</h4>
<p>This line seems relevant: </p>
<div class="codehilite"><pre><span></span><code><span class="w">        </span><span class="c1">// Note: when adding new syntax here, don&#39;t forget to adjust `TokenKind::can_begin_expr()`.</span>
</code></pre></div>



<a name="210804210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210804210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210804210">(Sep 21 2020 at 21:44)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="210804325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210804325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210804325">(Sep 21 2020 at 21:45)</a>:</h4>
<p>yeah, parse expr doesn't explain what's happening to you, as <code>[0; {}]</code> parses correctly. mb</p>
<p>you still want to parse a block here though :)</p>



<a name="210915300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915300">(Sep 22 2020 at 18:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="118594">ecstatic-morse</span> <a href="#narrow/stream/131828-t-compiler/topic/Inline.20const.20expressions/near/210804019">said</a>:</p>
<blockquote>
<p>This line seems relevant: </p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">        </span><span class="c1">// Note: when adding new syntax here, don't forget to adjust `TokenKind::can_begin_expr()`.</span>
</code></pre></div>

</blockquote>
<p>hey, I'm just back to check all this</p>



<a name="210915310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915310">(Sep 22 2020 at 18:54)</a>:</h4>
<p>unsure I got correctly what you meant here</p>



<a name="210915455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915455">(Sep 22 2020 at 18:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/131828-t-compiler/topic/Inline.20const.20expressions/near/210804325">said</a>:</p>
<blockquote>
<p>yeah, parse expr doesn't explain what's happening to you, as <code>[0; {}]</code> parses correctly. mb</p>
<p>you still want to parse a block here though :)</p>
</blockquote>
<p>I'm looking into this, wondering if something like <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/expr.rs#L1502-L1523">https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/expr.rs#L1502-L1523</a> would be what I need</p>



<a name="210915462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915462">(Sep 22 2020 at 18:55)</a>:</h4>
<p>investigating a bit</p>



<a name="210915718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915718">(Sep 22 2020 at 18:58)</a>:</h4>
<p>seems more like <a href="https://github.com/rust-lang/rust/blob/bf5cbd6b64ad331ff4198db45da6b72dc978d73a/compiler/rustc_parse/src/parser/stmt.rs#L305-L310">https://github.com/rust-lang/rust/blob/bf5cbd6b64ad331ff4198db45da6b72dc978d73a/compiler/rustc_parse/src/parser/stmt.rs#L305-L310</a> what I want</p>



<a name="210915790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915790">(Sep 22 2020 at 18:59)</a>:</h4>
<p>or <a href="https://github.com/rust-lang/rust/blob/bf5cbd6b64ad331ff4198db45da6b72dc978d73a/compiler/rustc_parse/src/parser/stmt.rs#L250-L257">https://github.com/rust-lang/rust/blob/bf5cbd6b64ad331ff4198db45da6b72dc978d73a/compiler/rustc_parse/src/parser/stmt.rs#L250-L257</a></p>



<a name="210915838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915838">(Sep 22 2020 at 18:59)</a>:</h4>
<p>hmm, <code>parse_block</code> seems the most correct here</p>



<a name="210915843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915843">(Sep 22 2020 at 18:59)</a>:</h4>
<p>I guess we don't want inner attributes so ...</p>



<a name="210915847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915847">(Sep 22 2020 at 18:59)</a>:</h4>
<p>yeah</p>



<a name="210915877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210915877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210915877">(Sep 22 2020 at 19:00)</a>:</h4>
<p>but that's not something I am too familiar with <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="210916011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210916011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210916011">(Sep 22 2020 at 19:00)</a>:</h4>
<p>I meant, I guess <code>const { }</code> is not a thing we decorate with attributes</p>



<a name="210916032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210916032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210916032">(Sep 22 2020 at 19:00)</a>:</h4>
<p>?</p>



<a name="210916054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210916054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210916054">(Sep 22 2020 at 19:01)</a>:</h4>
<p>yeah, at least not at the beginning</p>



<a name="210916075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210916075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210916075">(Sep 22 2020 at 19:01)</a>:</h4>
<p>right <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="210916161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210916161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210916161">(Sep 22 2020 at 19:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Inline.20const.20expressions/near/210915310">said</a>:</p>
<blockquote>
<p>unsure I got correctly what you meant here</p>
</blockquote>
<p>re this, it looks like appending kw::Const to <code>ident_can_begin_expr</code> is what's needed here</p>



<a name="210917137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210917137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210917137">(Sep 22 2020 at 19:08)</a>:</h4>
<p>ohh right</p>



<a name="210917469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210917469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210917469">(Sep 22 2020 at 19:10)</a>:</h4>
<p>what is exactly <code>P</code> in <code>P&lt;Expr&gt;</code>?</p>



<a name="210917613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210917613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210917613">(Sep 22 2020 at 19:10)</a>:</h4>
<p>it's a pointer to an expression I guess</p>



<a name="210917648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210917648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210917648">(Sep 22 2020 at 19:11)</a>:</h4>
<p>ohh I see <a href="https://github.com/rust-lang/rust/blob/bf5cbd6b64ad331ff4198db45da6b72dc978d73a/compiler/rustc_ast/src/ptr.rs#L32-L35">https://github.com/rust-lang/rust/blob/bf5cbd6b64ad331ff4198db45da6b72dc978d73a/compiler/rustc_ast/src/ptr.rs#L32-L35</a></p>



<a name="210917772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210917772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210917772">(Sep 22 2020 at 19:12)</a>:</h4>
<p>ahh I guess this is why <code>mk_expr</code> is constantly called in the code</p>



<a name="210917875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210917875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210917875">(Sep 22 2020 at 19:13)</a>:</h4>
<p><code>P</code> is weird</p>



<a name="210917903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210917903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210917903">(Sep 22 2020 at 19:13)</a>:</h4>
<p>esp I don't get why <code>fn P</code> requires <code>T</code> to be 'static</p>



<a name="210918077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210918077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210918077">(Sep 22 2020 at 19:14)</a>:</h4>
<blockquote>
<p>P&lt;T&gt; disallows mutating its inner T, unlike Box&lt;T&gt; (unless it contains an Unsafe interior, but that may be denied later). This mainly prevents mistakes, but can also enforces a kind of "purity".</p>
</blockquote>



<a name="210918103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210918103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210918103">(Sep 22 2020 at 19:15)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ptr/struct.P.html#impl-DerefMut">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ptr/struct.P.html#impl-DerefMut</a></p>



<a name="210918107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210918107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210918107">(Sep 22 2020 at 19:15)</a>:</h4>
<p>what</p>



<a name="210918151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210918151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210918151">(Sep 22 2020 at 19:15)</a>:</h4>
<p>will open a new topic for this <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="210920957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210920957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210920957">(Sep 22 2020 at 19:39)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="210921679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210921679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210921679">(Sep 22 2020 at 19:45)</a>:</h4>
<p>I'm still getting the very same error, hmm</p>



<a name="210922840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210922840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210922840">(Sep 22 2020 at 19:54)</a>:</h4>
<p>by that I meant</p>



<a name="210922849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210922849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210922849">(Sep 22 2020 at 19:54)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: expected identifier, found `{`
  --&gt; /home/santiago/src/oss/rust3/src/test/ui/parser/inline_const.rs:6:11
   |
LL |     const {
   |           ^ expected identifier

error: aborting due to previous error
</code></pre></div>



<a name="210922886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210922886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210922886">(Sep 22 2020 at 19:54)</a>:</h4>
<p>can you push to github?</p>



<a name="210923108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210923108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210923108">(Sep 22 2020 at 19:56)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...spastorino:const-exprs-rfc-2920">https://github.com/rust-lang/rust/compare/master...spastorino:const-exprs-rfc-2920</a></p>



<a name="210923239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210923239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210923239">(Sep 22 2020 at 19:57)</a>:</h4>
<p>so we prefer <code>const VALUE: ty</code> to expressions here</p>



<a name="210923322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210923322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210923322">(Sep 22 2020 at 19:58)</a>:</h4>
<p>It seems like we have to look at the next token there and decide on what to do</p>



<a name="210923438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210923438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210923438">(Sep 22 2020 at 19:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Inline.20const.20expressions/near/210802720">said</a>:</p>
<blockquote>
<p>to look ahead that it's not a <code>const {</code> thing</p>
</blockquote>
<p><span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span> ?</p>



<a name="210923766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210923766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210923766">(Sep 22 2020 at 20:01)</a>:</h4>
<p>I meant, what I was guessing before in <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#L864-L871">https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#L864-L871</a></p>



<a name="210924026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210924026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210924026">(Sep 22 2020 at 20:03)</a>:</h4>
<p><span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> jup</p>



<a name="210924637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210924637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210924637">(Sep 22 2020 at 20:08)</a>:</h4>
<p>maybe in <code>parse_stmt_without_recovery</code> before <code>parse_item_common</code>?</p>



<a name="210925681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210925681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210925681">(Sep 22 2020 at 20:17)</a>:</h4>
<p>I was checking also <code>parse_item_common</code> and those fns</p>



<a name="210925857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210925857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210925857">(Sep 22 2020 at 20:18)</a>:</h4>
<p>but ... I'm not sure if that's a better place ?</p>



<a name="210925934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210925934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210925934">(Sep 22 2020 at 20:19)</a>:</h4>
<p>also we could also add a feature flag check at that point</p>



<a name="210925959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210925959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210925959">(Sep 22 2020 at 20:19)</a>:</h4>
<p>to not modify anything on the parser if the feature flag is not enabled</p>



<a name="210926013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210926013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210926013">(Sep 22 2020 at 20:19)</a>:</h4>
<p>otherwise we would be probably modifying the parse error we are giving</p>



<a name="210926172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210926172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210926172">(Sep 22 2020 at 20:21)</a>:</h4>
<blockquote>
<p>but ... I'm not sure if that's a better place ?</p>
</blockquote>
<p>that's where I would put it <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> but it's maybe better to ask <span class="user-mention" data-user-id="119031">@Esteban Küber</span> or <span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> here</p>



<a name="210926304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210926304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210926304">(Sep 22 2020 at 20:22)</a>:</h4>
<p>I was directly modifying <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#L864-L871">https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#L864-L871</a></p>



<a name="210926357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210926357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210926357">(Sep 22 2020 at 20:22)</a>:</h4>
<p>it doesn't work either <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="210926651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210926651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210926651">(Sep 22 2020 at 20:25)</a>:</h4>
<p>I see why though</p>



<a name="210928525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210928525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210928525">(Sep 22 2020 at 20:40)</a>:</h4>
<p><code>parse_stmt_without_recovery</code> looks like a good candidate for this disambiguation.<br>
Things like <code>union U { ... }</code> vs <code>union { ... }</code> are already disambiguated there.</p>



<a name="210928598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Inline%20const%20expressions/near/210928598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Inline.20const.20expressions.html#210928598">(Sep 22 2020 at 20:41)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>